package com.eorchis.module.classplanapply.ui.commond;

import java.io.Serializable;

import org.hibernate.validator.constraints.NotBlank;

import com.eorchis.core.annotation.AuditIgnore;
import com.eorchis.core.annotation.AuditProperty;
import com.eorchis.core.basedao.entity.IBaseEntity;
import com.eorchis.core.ui.commond.ICommond;
import com.eorchis.module.classplanapply.domain.ClassPlanApply;
import com.eorchis.utils.utils.PropertyUtil;


/**
 * Title: ClassPlanApplyValidCommond<br>
 * Description: 班级计划报名ValidCommond<br>
 * Company: GoldGov<br>
 * Copyright @ 2012 GoldGov .All rights reserved.<br>
 * @author SHQ
 * @createDate 2016-01-05
 * @version $Revision$
 */
public class ClassPlanApplyValidCommond implements ICommond {
	
	private ClassPlanApply classPlanApply;
	private Integer reportedCount;//已报人数
	private Integer reportedCityCount;//已报市级人数
	private Integer reportedCountyCount;//已报县级人数
	private Integer surplusCount;//剩余人数=调整人数asignCount-已报人数reportedCount
	private String  searchDepId;//单位id
	
	public ClassPlanApplyValidCommond(){
		classPlanApply = new ClassPlanApply();
	}
	
	public ClassPlanApplyValidCommond(ClassPlanApply classPlanApply){
		this.classPlanApply = classPlanApply;
	}

	@AuditIgnore
	public Serializable getEntityID() {
		return classPlanApply.getPlanApplyId();
	}

	public IBaseEntity toEntity() {
		return classPlanApply;
	}

	/**
	 * 获取计划报名主键
	 */	
	@AuditProperty(value="计划报名主键")
	public String getPlanApplyId() {
		return classPlanApply.getPlanApplyId();
	}
	/**
	 * 设置计划报名主键
	 */		
	public void setPlanApplyId(String planApplyId) {
		classPlanApply.setPlanApplyId(planApplyId);
	}
	/**
	 * 获取报名单位ID
	 */	
	@AuditProperty(value="报名单位ID")
	public String getDeptId() {
		return classPlanApply.getDeptId();
	}
	/**
	 * 设置报名单位ID
	 */		
	public void setDeptId(String deptId) {
		classPlanApply.setDeptId(deptId);
	}
	/**
	 * 获取报名单位代码
	 */	
	@AuditProperty(value="报名单位代码")
	public String getDeptCode() {
		return classPlanApply.getDeptCode();
	}
	/**
	 * 设置报名单位代码
	 */		
	public void setDeptCode(String deptCode) {
		classPlanApply.setDeptCode(deptCode);
	}
	/**
	 * 获取报名单位名称
	 */	
	@AuditProperty(value="报名单位名称")
	public String getDeptName() {
		return classPlanApply.getDeptName();
	}
	/**
	 * 设置报名单位名称
	 */		
	public void setDeptName(String deptName) {
		classPlanApply.setDeptName(deptName);
	}
	/**
	 * 获取计划人数
	 */	
	@AuditProperty(value="计划人数")
	public Integer getPlanCount() {
		return classPlanApply.getPlanCount();
	}
	/**
	 * 设置计划人数
	 */		
	public void setPlanCount(Integer planCount) {
		classPlanApply.setPlanCount(planCount);
	}
	/**
	 * 获取调整人数
	 */	
	@AuditProperty(value="调整人数")
	public Integer getAsignCount() {
		if(classPlanApply.getAsignCount()==null){
			return 0;
		}
		return classPlanApply.getAsignCount();
	}
	/**
	 * 设置调整人数
	 */		
	public void setAsignCount(Integer asignCount) {
		classPlanApply.setAsignCount(asignCount);
	}
	/**
	 * 获取ID
	 */	
	@NotBlank(message="ID不能为空")
	@AuditProperty(value="ID")
	public String getClassId() {
		return classPlanApply.getClassId();
	}
	/**
	 * 设置ID
	 */		
	public void setClassId(String classId) {
		classPlanApply.setClassId(classId);
	}

	public Integer getCityPlanCount() {
		return classPlanApply.getCityPlanCount()==null?0:classPlanApply.getCityPlanCount();
	}

	public void setCityPlanCount(Integer cityPlanCount) {
		classPlanApply.setCityPlanCount(cityPlanCount);
	}

	public Integer getCountyPlanCount() {
		return classPlanApply.getCountyPlanCount()==null?0:classPlanApply.getCountyPlanCount();
	}

	public void setCountyPlanCount(Integer countyPlanCount) {
		classPlanApply.setCountyPlanCount(countyPlanCount);
	}

	public Integer getAsignCityCount() {
		if(classPlanApply.getAsignCityCount()==null){
			return 0;
		}
		return classPlanApply.getAsignCityCount();
	}

	public void setAsignCityCount(Integer asignCityCount) {
		classPlanApply.setAsignCityCount(asignCityCount);
	}

	public Integer getAsignCountyCount() {
		if(classPlanApply.getAsignCountyCount()==null){
			return 0;
		}
		return classPlanApply.getAsignCountyCount();
	}

	public void setAsignCountyCount(Integer asignCountyCount) {
		classPlanApply.setAsignCountyCount(asignCountyCount);
	}

	public Integer getReportedCount() {
		return reportedCount;
	}

	public void setReportedCount(Integer reportedCount) {
		this.reportedCount = reportedCount;
	}

	public Integer getReportedCityCount() {
		if(!PropertyUtil.objectNotEmpty(reportedCityCount)){
			return 0;
		}
		return reportedCityCount;
	}

	public void setReportedCityCount(Integer reportedCityCount) {
		this.reportedCityCount = reportedCityCount;
	}

	public Integer getReportedCountyCount() {
		if(!PropertyUtil.objectNotEmpty(reportedCountyCount)){
			return 0;
		}
		return reportedCountyCount;
	}

	public void setReportedCountyCount(Integer reportedCountyCount) {
		this.reportedCountyCount = reportedCountyCount;
	}

	public Integer getSurplusCount() {
		if(!PropertyUtil.objectNotEmpty(surplusCount)){
			return 0;
		}
		return surplusCount;
	}

	public void setSurplusCount(Integer surplusCount) {
		this.surplusCount = surplusCount;
	}

	public String getSearchDepId() {
		return searchDepId;
	}

	public void setSearchDepId(String searchDepId) {
		this.searchDepId = searchDepId;
	}
	
}
